package com.baizhiedu.service;

import com.baizhiedu.dao.UserDao;
import com.baizhiedu.entity.User;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * ClassName: UserServiceImpl
 * Description:
 * Date: 2022/11/23 PM 3:03:28
 * <p>
 * project: spring5
 * package: com.baizhiedu.service
 * email: 1085844536@qq.com
 * version:
 *
 * @author WangGuojian
 */
//@Transactional(rollbackFor = {Exception.class}, noRollbackFor = {RuntimeException.class})
public class UserServiceImpl implements UserService {
    private UserDao userDao;

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void register(User user) throws Exception {
        userDao.save(user);
        //throw new RuntimeException("测试");
        //throw new Exception("测试2");
    }

    @Override
    //@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
    public void login(String name, String password) {

    }
}
